package backstage.sys.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class PlatformLoaderListener implements ServletContextListener {

	private PlatformLoader platformLoader;

	/**
	 * 初始化平台.
	 */
	public void contextInitialized(ServletContextEvent event) {
		this.platformLoader = createPlatformLoader();
		this.platformLoader.init(event.getServletContext());
	}
	
	/**
	 * 关闭ServletContext.
	 */
	public void contextDestroyed(ServletContextEvent sce) {

	}

	/**
	 * 创建PlatformLoader使用
	 */
	protected PlatformLoader createPlatformLoader() {
		return new PlatformLoader();
	}

	public PlatformLoader getPlatformLoader() {
		return platformLoader;
	}
}
